package com.whu.service.impl;

import com.whu.service.BookService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class BookServiceImpl implements BookService {
    Logger logger = LoggerFactory.getLogger(getClass());
    @Override
    public void save(Integer i) throws Exception {
        if(i==1){
            logger.info("book save···");
        }else{
            throw new Exception("增加异常！！！");
        }

    }

    @Override
    public void delete(Integer i) throws Exception {
        if(i==1){
            logger.info("book delete···");
        }else{
            throw new Exception("删除异常！！！");
        }
    }

    @Override
    public void update(Integer i) throws Exception {
        if(i==1){
            logger.info("book update···");
        }else{
            throw new Exception("更新异常！！！");
        }
    }

    @Override
    public void getBook(Integer i) throws Exception {
        if(i==1){
            logger.info("book getBook···");
        }else{
            throw new Exception("查询异常！！！");
        }
    }
}
